package com.acquisition.service.impl;

import com.acquisition.entity.SysUser;
import com.acquisition.mapper.SysUserMapper;
import com.acquisition.service.SysUserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * @Author Jay Chou
 * @Description 用户表(SysUser)表服务实现类
 * @Date 2023-04-12 12:26
 **/
@Service("sysUserService")
public class SysUserServiceImpl implements SysUserService {

    @Resource
    private SysUserMapper sysUserMapper;

    /**
     * @Author Jay Chou
     * @Description 通过id查询用户信息
     * @Date 2023-04-12 13:46
     * @param id
     * @return com.acquisition.entity.SysUser
     **/
    @Override
    public SysUser queryById(String id) {
        return sysUserMapper.queryById(id);
    }

    /**
     * @Author Jay Chou
     * @Description 根据账号查询用户
     * @Date 2023-04-12 13:47
     * @param account
     * @return com.acquisition.entity.SysUser
     **/
    @Override
    public SysUser queryByAccount(String account) {
        return sysUserMapper.queryByAccount(account);
    }

    /**
     * @Author Jay Chou
     * @Description 按条件筛选分页查询用户列表
     * @Date 2023-04-12 13:47
     * @param sysUser
     * @return java.util.List<com.acquisition.entity.SysUser>
     **/
    @Override
    public List<SysUser> queryUserList(SysUser sysUser) {
        return sysUserMapper.queryUserList(sysUser);
    }

    /**
     * @Author Jay Chou
     * @Description 新增用户
     * @Date 2023-04-12 13:47
     * @param sysUser
     * @return int
     **/
    @Override
    public int insert(SysUser sysUser) {
        return sysUserMapper.insert(sysUser);
    }

    /**
     * @Author Jay Chou
     * @Description 修改用户
     * @Date 2023-04-12 13:47
     * @param sysUser
     * @return int
     **/
    @Override
    public int update(SysUser sysUser) {
        return sysUserMapper.update(sysUser);
    }

    /**
     * @Author Jay Chou
     * @Description 删除用户
     * @Date 2023-04-12 13:47
     * @param id
     * @return int
     **/
    @Override
    public int deleteById(String id) {
        return sysUserMapper.deleteById(id);
    }

}